﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 回文数
{
    class Program
    {
        static void Main(string[] args)
        {
            int test = 1221;
            Solution solution = new Solution();
            Console.WriteLine(solution.IsPalindrome(test));
            Console.ReadLine();

        }
    }

    public class Solution
    {
        public bool IsPalindrome(int x)
        {
            if (x < 0)
            {
                return false;
            }
            else
            {
                int a = 0;
                int y = x;
                while (y != 0)
                {
                    a = a * 10 + y % 10;
                    y = y / 10;
                }
                return a == x;
            }
        }
    }
}
